<template>
  <div class="employmentModule">
    <div class="pic-body"  @click="$router.push({name:'bysSjhz'})">
      <div>
        <div class="text_title">{{ data[0].sourceNumber }}</div>
        <div class="text_info">本届生源信息总数</div>
      </div>
    </div>
    <div class="pic-body" @click="$router.push({name:'jyqxInfoManage'})">
      <div>
        <div class="text_title">{{ data[0].jyqxNumber }}</div>
        <div class="text_info">全部去向信息</div>
      </div>
    </div>
    <div class="pic-body" @click="goJyqxManage(0)">
      <div>
        <div class="text_title">{{ data[0].waitApplyNumber }}</div>
        <div class="text_info">待提交（含待填报、撤回、草稿）</div>
      </div>
    </div>
    <div class="pic-body" @click="goJyqxManage(2)">
      <div>
        <div class="text_title">{{ data[0].waitDoneNumber }}</div>
        <div class="text_info">待审核去向登记</div>
      </div>
    </div>
    <div class="pic-body" @click="goJyqxManage(6)">
      <div>
        <div class="text_title">{{ data[0].passNumber }}</div>
        <div class="text_info">审核通过</div>
      </div>
    </div>
    <div class="pic-body" @click="goJyqxManage(10)">
      <div>
        <div class="text_title">{{ data[0].turnDownNumber }}</div>
        <div class="text_info">驳回的去向信息</div>
      </div>
    </div>
  </div>
</template>

<script>

import {getStatisticalData} from '@/api/bys/jyqx/jyqx';
import Cookies from 'js-cookie';

export default {
  data() {
    return {
      loading: false,
      columns: [
        {
          title: '本届生源',
          key: 'sourceNumber',
          className: 'demo-table-info-column-title'
          // sortable: true,
        },
        {
          title: '全部去向信息',
          key: 'jyqxNumber',
          className: 'demo-table-info-column-title'
        },
        {
          title: '待填报',
          key: 'waitApplyNumber',
          className: 'demo-table-info-column-title'
          // minWidth: 120,
          // sortable: false,
        },
        {
          title: '待审核',
          key: 'waitDoneNumber',
          className: 'demo-table-info-column-title'
          // minWidth: 120,
          // sortable: false,
        },
        {
          title: '审核通过',
          key: 'passNumber',
          className: 'demo-table-info-column-title'
          // minWidth: 120,
        },

        {
          title: '驳回',
          key: 'turnDownNumber',
          className: 'demo-table-info-column-title'
        }
      ],
      data: [{sourceNumber: '**', jyqxNumber: '**',waitApplyNumber: '**', waitDoneNumber: '**', passNumber: '**', turnDownNumber: '**'}],
      total: 0, // 表单数据总数
      searchForm: {
        name: '',
        pageNumber: 1,
        pageSize: 2,
        sort: 'createTime',
        order: 'desc',
        isHl: 0
      }
    };
  },
  methods: {
    init() {
      this.getDataList();
    },
    goJyqxManage(i){
      let that = this,index = -1,userInfo={}
      userInfo =JSON.parse( Cookies.get('userInfo'))
      console.log(userInfo);
      if (i>-1){
        if (i ==2){
          if(userInfo.resource ==2){
            index = 3
          };
          if(userInfo.resource == 3){
            index = 4
          }
        }else {
          index = i
        }
      }
        if (index>-1){
          this.$router.push({
            name:'jyqxManage',
            query:{
              status: index
            }
          })
        }

    },
    // 获取表格数据
    getDataList() {
      this.loading = true;
      getStatisticalData().then(res => {
        this.loading = false;
        if (res.code === 200) {
          if (res.result) {
            this.data = [];
            this.data.push(res.result);
          }
        }
        console.log('getStatisticalData', res);
      });
    },
    // 排序
    changeSort(e) {
    },
    // 改变单行颜色
    rowClassName(row, index) {
      if (index === 1) {
        return 'demo-table-info-row';
      } else if (index === 3) {
        return 'demo-table-error-row';
      }
      return '';
    },
    //   分页
    changePage(v) {
      this.searchForm.pageNumber = v;
      this.getDataList();
      this.clearSelectAll();
    },
    changePageSize(v) {
      this.searchForm.pageSize = v;
      this.getDataList();
    },
    seeView(e) {
      let query = {
        id: e.tableId,
        type: '3',
        backRoute: this.$route.name,
        applyId: e.applyerUserid,
        tId: e.id,
        procInstId: e.procInstId
      };
      this.$router.push({
        name: e.routeName,
        query: query
      });
    },
    async remove(e) {
      let res = await this.postRequest('/actTask/hl', {businessKey: e.businessKey});
      if (res.success) {
        this.getDataList();
      }
    }
  },
  mounted() {
    this.init();
  }
};
</script>

<style scoped lang="less">
.pic-body:hover {
  box-shadow: 0 0 5px #f1f1f1;
}

.pic-body {
  width: 238px;
  height: 140px;
  background-image: linear-gradient(to left, #f7f9fd, #eef4fc);
  background-size: 268px 120px;
  display: flex;
  align-items: center;
  padding: 0px 24px;
  border-radius: 8px;
  cursor: pointer;
}

.text_title {
  font-size: 20px;
  font-weight: 600;
  color: #333333;
}

.text_info {
  margin-top: 10px;
  font-size: 14px;
  color: #333333;
}

.employmentModule {
  display: flex;
  justify-content: space-between;
}
</style>
